#ifndef COLLECTION_H
#define COLLECTION_H

#include <QList>
#include <QDir>
#include <QString>

#include "../qt_serialize.h"

#include "../trackinfo.h"

namespace Playur {
  
class Artist;
class Album;
class Track;

class Collection
{
public:
  Collection();
  
  void addFolder(const QString& path);
  void scan();
  
  QString nickname();
  void setNickname(const QString& nickname);
  
  QString url();
  void setUrl(const QString& url);
  
  QString getTrackPath(int id);

  const QString& xml();
  
  ~Collection();

  QList<Playur::TrackInfo> tracks;
  
private:
  void recurseInto(const QDir& dir);
  void addTrack(const QString& arg1);
  void updateXml();
    
  QString _nickname;
  QString _url;
  
  QList<QString> folders;
  
  /* Data storage */
  

  QString _xml;

  private:
    friend class boost::serialization::access;
    template<class Archive>
    void serialize(Archive & ar, const unsigned int version) {
        ar & NVP(_nickname) & NVP(_url) & NVP(tracks);
    }
};

}

#endif // COLLECTION_H
